home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Graphismes / Bitmap / NIH Image 1.59 / Macros / ROI Macros < prev    next >
Text File  |  1994-06-22  |  650b  |  36 lines

  1. macro 'Gray level wand tool [W]';
  2. var
  3.    x,y:integer;
  4. begin
  5.   Requiresversion(1.55);
  6.   KillROI;
  7.   repeat
  8.   SetCursor('arrow');
  9.   showmessage('Click on the image');
  10.   until button;
  11.   GetMouse(x,y);
  12.   AutoThreshold;
  13.   AutoOutline(x,y);
  14.   SetThreshold(-1);
  15. end;
  16.  
  17. macro 'Fill Selection, Erase Background';
  18. {Fills selection to black and sets everything else white.}
  19. var
  20.   left,top,width,height:integer;
  21. begin
  22.    GetRoi(left,top,width,height);
  23.    if width=0 then begin
  24.       PutMessage('Selection required.');
  25.       exit;
  26.    end;
  27.    SetForeground(255); {Black}
  28.    SetBackground(0); {White}
  29.    SelectAll;
  30.    Clear;
  31.    RestoreRoi;
  32.    Fill;
  33.    KillRoi;
  34. end;
  35.  
  36.